package com.samuel.igoodman.entity.account;

import java.util.Date;

import com.samuel.igoodman.entity.POJO;

public class Userinfo extends POJO {

	public static final String SESSION_PARAMETER_NAME = "current_userinfo";

	public static final Userinfo INSTANCE = new Userinfo();

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	// private long id;
	private String username;
	private String userpwd;
	private String email;
	private int status;
	private Date createTime;

	// public long getId() {
	// return id;
	// }
	// public void setId(long id) {
	// this.id = id;
	// }
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUserpwd() {
		return userpwd;
	}

	public void setUserpwd(String userpwd) {
		this.userpwd = userpwd;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Override
	public String where() {
		StringBuffer where = new StringBuffer(" 1 = 1 ");
		if (null != username && !"".equals(username)) {
			where.append(" AND username = '" + username + "' ");
		}
		if (null != userpwd && !"".equals(userpwd)) {
			where.append(" AND userpwd = '" + userpwd + "' ");
		}
		if (null != email && !"".equals(email)) {
			where.append(" AND email = '" + email + "' ");
		}
		return where.toString();
	}

}
